<?php

ini_set("include_path", ".:..:../..");

require('./core/Smarty_oRs.php');
require('./includes/config.php');
require('./includes/rights.php');
require('./includes/func_database.php');
require('./includes/func_news.php');

$dbh = initConnection();

$news = new news;

$smarty = new Smarty_oRs;

if(isset($_GET['item'])) {

    $news_id = $_GET['item'];

    $item = $news->get($news_id, 9);

    $smarty->assign('item', $item[0]);

    $smarty->display('news-single.tpl', $_SESSION['uid']);

} else {

    $items = $news->get(0, 9);

    $smarty->assign('news', $items);

    $smarty->display('news-xml.tpl', $_SESSION['uid']);

}
?>
